package com.lighting.common.feign.search.dto.inside;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghanjun
 * @date 2022-06-11 18:33
 */
@Getter
@Setter
public class Condition {

    @ApiModelProperty("查询字段")
    private String fieldName;

    @ApiModelProperty("查询字段")
    private String[] fieldNames;

    @ApiModelProperty("查询值")
    private Object value;

    @ApiModelProperty("查询值范围")
    private Object valueTo;

    @ApiModelProperty("查询字段格式化")
    private String format;

    @ApiModelProperty("查询类型")
    private String queryType;

    @ApiModelProperty("评分权限")
    private Float boost;

    private List<Condition> conditionList = new ArrayList<>();

    public Condition() {

    }

    public Condition(String fieldName, Object value, String queryType) {
        this.fieldName = fieldName;
        this.value = value;
        this.queryType = queryType;
    }

    public Condition(String fieldName, Object value, Object valueTo, String queryType, String format) {
        this.fieldName = fieldName;
        this.value = value;
        this.valueTo = valueTo;
        this.queryType = queryType;
        this.format = format;
    }
}
